define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function(){
		this.callParent();
		this.categoryInfoId = null;
	};

//	Model.prototype.infoDateCustomRefresh = function(event){
//	    if(this.categoryInfoId){
//	        console.log('infoId',this.categoryInfoId);
//	    	var url = "http://139.129.25.140:8080/ex_community/a/api/community/getClassInfoDetail?callback=?&id="+this.categoryInfoId;
//			$.getJSON(
//					url,
//					function(data){
//					  //  console.log("info",data);
//						event.source.loadData([data]);
//						console.log('infodata',event.source.getFirstRow());
//					}
//			);
//	    }
//		
//	};

//	Model.prototype.modelParamsReceive = function(event){
//		this.categoryInfoId = this.getContext().getRequestParameter("catInfoId");
//		this.comp("infoDate").refreshData();
//	};

	Model.prototype.infoDateCustomRefresh = function(event){
   	    if(this.categoryInfoId){
	    	var url = "http://101.201.49.208:8080/ex_community/a/api/community/getClassInfoDetail?callback=?&id="+this.categoryInfoId;
			$.getJSON(
					url,
					function(data){
						event.source.loadData([data]);
						event.source.first();
					}
			);
	    }
	};

	Model.prototype.backBtnClick = function(event){
		justep.Shell.showPage("$UI/communityOto/category/categoryInfoList.w");
	};

	Model.prototype.modelParamsReceive = function(event){
		this.categoryInfoId = this.getContext().getRequestParameter("catInfoId");
		this.comp("infoDate").refreshData();
	};

	return Model;
});